import request from '../../utils/request'


export const loginAPI = async (data) =>{
    console.log("login data:",data);
    
  try{

    const res=await request.post('/users/login', data, 'api/v1', { method: 'POST' })
    console.log(res);
    if(res){
      return res
    }else{
      throw new Error('Login failed')
    }

  }catch(err){
    console.log(err)
  }

}



export const logoutAPI = () =>
  request.post('/user/logout', {}, 'api/v1', { method: 'POST' })
